<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-if 指令</title>
</head>
<body>
    <div id="itany">
    <!-- <button v-on:click="change">隐藏</button> -->
    <button v-on:click="flag=!flag">隐藏</button>
     <div  style="width:100px;height:100px;background-color: red" v-show="flag">欢迎来到南京网博</div>
    </div>
      
    
</body>
<script src="../utils/vue.js"></script>
<script>
    new Vue({
      el: "#itany",
      data: {
          flag: true,
      },
    //   methods:{
    //       change(){
    //           // this.flag = flag
    //           this.flag =! this.flag
    //       }
    //   }
    })
</script>
</html>